<!DOCTYPE html>
<html lang="zh">

<head>
    {% load static %}
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>员工管理系统主页</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/index.css' %}">
    {% comment %} <script type="text/javascript" src="{% static 'js/index.js' %}"></script> {% endcomment %}
    <script>
        function goto_insert_page() {
            // 在当前页打开录入信息界面
            window.open("http://" + location.host + "/insert_info/{{ user_name }}/", "_self");
        }

        function goto_query_page() {
            // 在当前页打开查看信息界面
            window.open("http://" + location.host + "/query_info/{{ user_name }}/", "_self");
        }

        function goto_update_page() {
            // 在当前页打开修改信息界面
            window.open("http://" + location.host + "/update_info/{{ user_name }}/", "_self");
        }

        function goto_delete_page() {
            // 在当前页打开删除信息界面
            window.open("http://" + location.host + "/delete_info/{{ user_name }}/", "_self");
        }
    </script>
</head>

<body>
    {% if log_in %}
    <header>
        <p>欢迎你，{{ user_name }}</p>
    </header>
    <main>
        <h1>欢迎使用员工管理系统</h1>
        <h2>请点击按钮进入功能页面</h2>
        <div class="button_div" id="button_div_1">
            <button onclick="goto_insert_page()">录入员工信息</button>
            <button onclick="goto_query_page()">查看员工信息</button>
        </div>
        <div class="button_div" id="button_div_2">
            <button onclick="goto_update_page()">修改员工信息</button>
            <button onclick="goto_delete_page()">删除员工信息</button>
        </div>
        <p id="hint" hidden>注：如要导入数据文件请点击“录入员工信息”，如要导出数据文件请点击“查看员工信息”</p>
    </main>
    <footer>
        <p>Copyright © 2021 zzll0909</p>
    </footer>
    {% endif %}
</body>

</html>